home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000806_andreas@mpa-garching.mpg.de_Tue Jul 26 12:11:54 1994.msg < prev    next >
Internet Message Format  |  1994-10-11  |  6KB

  1. Received: from ibm-1.mpa-garching.mpg.de by cs.umb.edu with SMTP id AA15127
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Tue, 26 Jul 1994 04:11:02 -0400
  3. Received: (andreas@localhost) by ibm-1.MPA-Garching.MPG.DE (8.6.8.1/8.6) id KAA144866; Tue, 26 Jul 1994 10:11:54 +0200
  4. Date: Tue, 26 Jul 1994 10:11:54 +0200
  5. From: Andreas Schott <andreas@mpa-garching.mpg.de>
  6. Message-Id: <199407260811.KAA144866@ibm-1.MPA-Garching.MPG.DE>
  7. To: mackay@cs.washington.edu (Pierre MacKay)
  8. Cc: tex-k@cs.umb.edu
  9. Subject: filnames in UNIX-TeX
  10. In-Reply-To: <199407251659.JAA28904@june.cs.washington.edu>
  11. References: <199407251639.SAA52817@ibm-1.MPA-Garching.MPG.DE>
  12.     <199407251659.JAA28904@june.cs.washington.edu>
  13. Reply-To: andreas@mpa-garching.mpg.de (Andreas Schott)
  14.  
  15. (I changed the subject to what appears to be the real topic)
  16.  
  17. > If you locally change the \catcodes of the characters that
  18. > are causing you difficulty to \catcode11, you will be
  19. > able to use them in file names (but if you do that with \
  20. > you had better have a substitute \catcode0 character to
  21. > get you back.  
  22.  
  23. No, no. I want to have the opposite. Why does the brace
  24. not have the catcode 1 in filenames, respectively not
  25. belong to the filename, but delimit it. I did not change it.
  26. I don't want to be able to use such strange characters in
  27. filenames, I want them to behave like what they are in
  28. normal TeX-code, at least if I do not do changes of catcodes.
  29.  
  30. But I see not how this should work (see below). At the moment
  31. It seems to me that only the backslash, blank, tab, newline
  32. and the percent-sign delimit a filename. 
  33.  
  34. And changing catcodes does not work for filenames. The
  35. following should show that. The file abc.tex contains:
  36.  \catcode`\@=10
  37.  \catcode`\ =11
  38.  \input@file test
  39. The TeX-output was:
  40.  This is TeX, Version 3.1415 (C version 6.1)
  41.  (abc.tex
  42.  ! I can't find file `file'.
  43.  l.4 \input@file 
  44.                  test
  45.  Please type another input file name:
  46.  ... 
  47. This shows that in filenames the blank is always a delimiter,
  48. not depending on its catcode. So I see not how could read
  49. arbitrary filenames (I was not able to get a token-register
  50. expanded after an \input and be used as filename. The backslash
  51. always seemed to to be a delimiter to a null-filename).
  52.  
  53. > $ will still be a literal, because your are still not
  54. > going through the system interface.  You will
  55. > be able to pick up the literal filename 'file${abc}'
  56. > You will not be able to do value substitution on
  57. > the set variable abc.  Find a Unix C manual and look at the
  58.  
  59. Really, this is what I expected, but I got variable-substitution,
  60. really. I did:
  61. I had a file `a.tex' with the contents:
  62.  \input b${abc}
  63.  \bye
  64. Second a file `btest.tex' with the contents:
  65.  \message{This file used variable substitution}
  66. Third a file `b${abc}.tex' (funny name, I know) with contents:
  67.  \message{This file is what I expect}
  68. Then I did:
  69.  setenv abc test
  70.  tex a
  71. And I got:
  72.  This is TeX, Version 3.1415 (C version 6.1)
  73.  (a.tex (btest.tex This file used variable substitution) )
  74.  No pages of output.
  75.  Transcript written on a.log.
  76.  
  77. Sorry, I was a little bit too fast. The last statement holds
  78. for Solaris 2.3. On an RS6000 with AIX 3.2.5 I got the file
  79. `b${abc}' read. So it seems to be a feature of Solaris. The
  80. last relevant lines of truss, which monitors systems-calls
  81. shows the following output:
  82.  stat("a", 0xEFFFEEA0)                           Err#2 ENOENT
  83.  stat("a.tex", 0xEFFFEE18)                       = 0
  84.  access("./a.tex", 4)                            = 0
  85.  stat("./a.tex", 0xEFFFF048)                     = 0
  86.  open("./a.tex", O_RDONLY, 0666)                 = 3
  87.  open("a.log", O_WRONLY|O_CREAT|O_TRUNC, 0666)   = 4
  88.  fstat(4, 0xEFFFF1F0)                            = 0
  89.  ioctl(4, TCGETA, 0xEFFFF17C)                    Err#25 ENOTTY
  90.  (a.texwrite(1, " ( a . t e x", 6)                       = 6
  91.  fstat(3, 0xEFFFF250)                            = 0
  92.  ioctl(3, TCGETA, 0xEFFFF1DC)                    Err#25 ENOTTY
  93.  read(3, " \ i n p u t   b $ { a b".., 4096)     = 20
  94.  stat("b${abc}", 0xEFFFED50)                     Err#2 ENOENT
  95.  stat("b${abc}.tex", 0xEFFFECC8)                 = 0
  96.  brk(0x003D4468)                                 = 0
  97.  brk(0x003D6468)                                 = 0
  98.  access("./btest.tex", 4)                        = 0
  99.  stat("./btest.tex", 0xEFFFEEF8)                 = 0
  100.  open("./btest.tex", O_RDONLY, 0666)             = 5
  101.   (btest.texwrite(1, "   ( b t e s t . t e x", 11)               = 11
  102.  fstat(5, 0xEFFFF100)                            = 0
  103.  ioctl(5, TCGETA, 0xEFFFF08C)                    Err#25 ENOTTY
  104.  read(5, " \ m e s s a g e { T h i".., 4096)     = 47
  105.   This file used variable substitutionwrite(1, "   T h i s   f i l e   u".., 37) = 37
  106.  read(5, 0x003D447C, 4096)                       = 0
  107.  )write(1, " )", 1)                              = 1
  108.  lseek(5, 0, 1)                                  = 47
  109.  close(5)                                        = 0
  110.  
  111. It seems to me that the file `b${abc}.tex' is really found with
  112. stat, but then there is something strange happening: access, stat
  113. and open are performed on the file `btest.tex'. I should do some
  114. more checks not using TeX, to see whether this is a `feature' of
  115. Solaris.
  116.  
  117. Andreas Schott.
  118. ----------------------------------------------------------------
  119. email: A.Schott@ipp-garching.mpg.de  |  :-O   Wissen ist Macht!
  120.        andreas@mpa-garching.mpg.de   |  8-(   Ich wei"s nichts.
  121. phone: +49 89 3299-2180              |  ;->   Macht auch nichts.